- /* sdbcnstr.cpp by K.Tsuru */
- // function ID = 33
- /****************************
- SDouble class
- constructor with type and size
- *****************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- /**************************************************************************
- All the elements of figure[] are initialized by zero.
- Use for a valiable whose necessary size is known in advance to avoid the
- reallocations of memory which may yield "out of memory" error.
- ***************************************************************************/
-
- SDouble::SDouble(NumberType tp, uint vsz):SNumber(tp), rdxExp(0)
- {
- uint sz;
- if(tp == BIN_DEC) vsz = SNMaxSize(BIN_DEC);
- if(vsz == 0) return;
- sz = min(vsz, SNMaxSize(tp));
- if(sz > minArraySize) CutDown(DISABLE);
- valloc(sz, 0);
- if(tp == BIN_DEC) return;
-
- uchar cd = 0;
- if( (CutDown() == DISABLE) && (PushedCD() & PUSH) ){
- cd = PushedCD();
- cd |= SD_PUSH;
- }
- if( (sz > minArraySize) && (reduceMaxSize != DISABLE) ){
- /*
- In the Newton's method with "the method of doubling effective figures" SetEffFig()
- is used to tempolally reduce the effective figures, but it must not reduce the
- maximum size.
- */
- reduceMaxSize = DISABLE;
- cd |= REDUCE_MAX_SIZE_DISABLE;
- }
- if(cd) PushCD(cd);
- }
sdbcnstr.cpp : last modifiled at 2015/11/25 20:14:10(1,275 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).